feat(finding): pluggable false-positive-history candidate filter#15238
Merged
Conversation
Add FINDING_FALSE_POSITIVE_HISTORY_CANDIDATE_FILTER_METHOD hook to do_false_positive_history_batch. When configured, the per-finding candidate list resolved by the deduplication algorithm is passed through the plugin method before the FP decision, letting a plugin (Pro) narrow candidates by fields excluded from the hash string but compared per pair (set-match tokens on vulnerability_ids / CWEs). Resolved once via get_custom_method; a no-op when unset, so default behavior is unchanged. Tests: hook can suppress matches (drops candidates -> no FP replication) and passthrough matches the default path.
blakeaowens
approved these changes
Jul 14, 2026
Jino-T
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #15155, which GitHub auto-closed when its base branch (#15143
feat/cwe-vuln-id-consolidation) was merged and its branch deleted. Same commit, authored by @valentijnscholten, rebased cleanly onto currentdev(post #15145 + #15143 merges) — no code changes, conflict-free.What this does
Adds a pluggable false-positive-history candidate filter.
do_false_positive_history_batchresolvesget_custom_method("FINDING_FALSE_POSITIVE_HISTORY_CANDIDATE_FILTER_METHOD")once per batch and applies it per finding (existing = fp_candidate_filter(finding, existing)). When no custom method is configured the guard skips it, so default behavior is byte-identical to before. This lets DefectDojo Pro plug in set-based (vulnerability-id / CWE) false-positive-history matching.Includes
unittests/test_false_positive_history_logic.pycoverage (passthrough equivalence + the hook path).🤖 Generated with Claude Code